<template>
  <div class="newLeftMenu">
<!--    <div class="top">-->
<!--      <i class="iconfont icon-matou2"></i>-->
<!--    </div>-->
    <el-menu
        class="el-menu-vertical-demo"
        :default-active="$route.fullPath"
        @select="handlerSelect">
      <el-submenu index="1">
        <template slot="title">我的委托</template>
        <el-menu-item index="/goodContent/goods">件散货业务</el-menu-item>
        <el-menu-item index="/goodContent/boxGoods">集装箱业务</el-menu-item>
        <el-menu-item index="/shipPlan/shipPlanList">船期计划</el-menu-item>
<!--        <el-menu-item index="/empty1">车队计划</el-menu-item>-->
      </el-submenu>
      <el-submenu index="2">
        <template slot="title">消息中心</template>
        <el-menu-item index="/myMessage">我的消息</el-menu-item>
      </el-submenu>
      <el-submenu index="3">
        <template slot="title">安全中心</template>
        <el-menu-item index="/safetyGuard">账号安全</el-menu-item>
      </el-submenu>
      <el-submenu index="4">
        <template slot="title">资料中心</template>
        <el-menu-item index="/userCenter/userInfo">企业信息</el-menu-item>
        <el-menu-item index="/fleetInformation/fleetList" >车队信息</el-menu-item>
        <el-menu-item index="/userInformation">用户信息</el-menu-item>
      </el-submenu>
      <el-submenu index="5">
        <template slot="title">查询统计</template>
        <el-menu-item index="/vehicleOperation">车辆作业</el-menu-item>
        <el-menu-item index="/goodsDetails">货物明细</el-menu-item>
        <el-menu-item index="/containerVehicleDetails">集装箱运输明细</el-menu-item>
        <!-- <el-menu-item index="/shipOperation">船舶作业</el-menu-item> -->
      </el-submenu>
      <el-submenu index="6">
        <template slot="title">API服务</template>
        <el-menu-item index="/api">API</el-menu-item>
      </el-submenu>
      <el-submenu index="7">
        <template slot="title">海关报关</template>
        <el-menu-item index="/manifestInformation">舱单信息</el-menu-item>
      </el-submenu>
    </el-menu>
  </div>

</template>

<script>
export default {
  name: "newLeftMenu",
  computed:{
    userType(){
      return this.$store.getters.userType
    },
  },
  methods: {
    handlerSelect(index){
      if(index == '/api'){
        this.$router.push('/api')
      }else if(index == '/fleetInformation/fleetList'){
        if(this.userType.includes('运输公司')){
          this.$router.push(index)
        }
        else{
          this.$router.push({name:'noPermission1'})
        }
      }else{
        this.$router.push(index)
      }

    },
  }
}
</script>

<style scoped lang="less">
/deep/.el-menu-item.is-active{
  background-color: #0F47B8;
  color: white;
}
/deep/.el-submenu__title:hover{
  background-color: #0F47B8;
  color: white;
}
/deep/.el-menu-item:hover{
  background-color: #0F47B8;
  color: white;
}
/deep/.el-menu{
  border-right: none;
}
/deep/.el-submenu.is-active .el-submenu__title{
  //font-size: 15px;
 // font-weight: 600;
}
.newLeftMenu{
  background-color: white;
  width: 200px;
  // min-height: 800px;
  height: 80%;
  // height: 80rem;
  //max-height: 1200px;
  overflow-y: auto;
  overflow-x: hidden;
  .top{
    width: 100%;height: 47px;background-color: #E4E4E4;
    display: flex;
    align-items: center;
    justify-content: center;
    i{
      font-size: 24px;
      color:rgba(119,119,119,0.7);
    }
  }
}
</style>